package com.zzyk.microCloud.controller;

import com.zzyk.main.configuration.jwt.JwtToken;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @description:
 * @author: wss_PC
 * @time: 2020/11/5 13:42
 */
@Controller
public class PageController {
    @RequestMapping("/")
    public String page() {
        return "index";
    }
    @RequestMapping("/pages/home")
    public String home(String token) {
        Subject subject = SecurityUtils.getSubject();
        JwtToken jwtToken = new JwtToken(token);
        if (!subject.isAuthenticated()) {
            subject.login(jwtToken);
        }
        return "pages/home";
    }
}
